With the development of multi-frame exposure composition high dynamic range (HDR) imaging technologies, in a current consumer market, an HDR photography function is integrated into a smart phone, such as an IPHONE. That is, in a scenario in which a camera stays stable or still, a photography effect is improved to different degrees, and a capability of presenting details in a bright or dark place is improved correspondingly.
However, in a scenario in which a camera shakes or a moving object exists, a poor condition such as a ghost or a blur occurs in an HDR image composited by multi-exposure frames. Frames photographed at different exposure levels significantly differ in luminance.
In the prior art 1, in order to correct an image composited by multi-exposure frames in a motion process, a motion correction method is provided. In this method, mapping is first performed according to a mapping relationship between an exposure frame and a camera response curve, and a luminance of a dark frame is improved; then, a frame-level motion vector is calculated by using a bi-directional prediction method, and correction is performed for the motion vector; finally, local motion is corrected by using a gradient-based optical flow method. However, the method is not only extremely complex but also has an unsatisfactory correction effect because the camera response curve needs to be obtained by using an image sensor and another processing module.
In the prior art 2, a motion correction method is further provided. In this method, a luminance of a first frame is corrected to a luminance range of a second frame by using a luminance mapping function, and then a motion condition between the two frames is detected; and for a motion area, a luminance value of the area which is mapped from the first frame is used to directly replace a pixel value corresponding to the second frame.
However, when a camera moves during photographing, all areas detected by using this method are motion areas, a second frame image corrected by means of replacement has basically lost detail information under the exposure condition, and an effect of a finally composited HDR image is also unsatisfactory. Motion areas determination is relatively difficult, especially for an exposure frame that undergoes luminance mapping, and it is difficult to ensure a result of the motion areas determination due to a different noise level/an over-exposure or under-exposure area. Therefore, a phenomenon of obvious discontinuity in the second frame image after correction likely occurs on an edge of a motion area, which directly affects a final HDR composition effect.
Therefore, in the process of research and practice in the prior art, the inventor of the present invention finds that in an existing implementation manner, no matter in the prior art 1 or in the prior art 2, a multi-exposure frame motion image cannot be effectively corrected in a scenario in which a camera shakes or a moving object exists.